<?php
namespace App\Controller;
use Think\Controller;
class ClassController extends Controller {
    public function index(){

    }
    public function classjson(){
    	//徐镜宁做的获取课程详细信息8.24
        $data = M('class');
        $classid=$_GET['classid'];
        $d=$data->join('yuejian_club on yuejian_club.clubid = yuejian_class.clubid')->join('yuejian_coach on yuejian_coach.coachid = yuejian_class.coachid')->field('yuejian_class.*,yuejian_club.clubname,yuejian_coach.coachname')->where("classid='$classid'")->select(); 
        //echo $data->getLastSQL();exit;
        var_dump($d);
        echo json_encode($d);	
    }
    public function classlist(){
    	//徐镜宁做的获取课程列表8.24
    	$classlist = M('class');
    	$allclasslist = $classlist->field('yuejian_class.classname,yuejian_class.classprice')->select();
    	echo json_encode($allclasslist);
    }
}